package com.symria.server.po;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Formula;

/**
 * PackDateReport entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PACK_DATE_REPORT")
public class PackDateReport implements java.io.Serializable {

	// Fields

	private Integer id;
	private Integer channelId;
	private Integer packId;
	private Integer actionCount;
	private Integer factCount;
	private Date createDate;
	private Double packPrice;
	private Double factMoney;
	private String state;
	private String packName;
	private String channelName;
	private String url;
	
	// Constructors

	/** default constructor */
	public PackDateReport() {
	}
	
	@Formula("(SELECT p.CHECK_URL FROM PACK_INFO p WHERE p.ID=PACK_ID)")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
    @Formula("(SELECT p.PACK_NAME FROM PACK_INFO p WHERE p.ID=PACK_ID)")
	public String getPackName() {
		return packName;
	}

	public void setPackName(String packName) {
		this.packName = packName;
	}
	
	
	@Formula("(SELECT ui.REAL_NAME FROM USER_INFO ui WHERE ui.USER_ID=CHANNEL_ID)")
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	/** full constructor */
	public PackDateReport(Integer channelId, Integer packId,
			Integer actionCount, Integer factCount, Date createDate,
			Double packPrice) {
		this.channelId = channelId;
		this.packId = packId;
		this.actionCount = actionCount;
		this.factCount = factCount;
		this.createDate = createDate;
		this.packPrice = packPrice;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "CHANNEl_ID")
	public Integer getChannelId() {
		return this.channelId;
	}

	public void setChannelId(Integer channelId) {
		this.channelId = channelId;
	}

	@Column(name = "PACK_ID")
	public Integer getPackId() {
		return this.packId;
	}

	public void setPackId(Integer packId) {
		this.packId = packId;
	}

	@Column(name = "ACTION_COUNT")
	public Integer getActionCount() {
		return this.actionCount;
	}

	public void setActionCount(Integer actionCount) {
		this.actionCount = actionCount;
	}

	@Column(name = "FACT_COUNT")
	public Integer getFactCount() {
		return this.factCount;
	}

	public void setFactCount(Integer factCount) {
		this.factCount = factCount;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATE_DATE", length = 0)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "PACK_PRICE", precision = 10)
	public Double getPackPrice() {
		return this.packPrice;
	}

	public void setPackPrice(Double packPrice) {
		this.packPrice = packPrice;
	}
	@Column(name = "FACT_MONEY", precision = 10)
	public Double getFactMoney() {
		return factMoney;
	}

	public void setFactMoney(Double factMoney) {
		this.factMoney = factMoney;
	}
	@Column(name = "STATE", precision = 1)
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	

}